#region Using References

using System.ComponentModel;
using Beaker.OpenCube.Dynamic;

#endregion

namespace Beaker.OpenCube.WorldViewer.ViewModels
{
	public sealed class ChunkViewModel
		: ViewModel
	{
		private readonly MainViewModel _owner;

		internal ChunkViewModel( MainViewModel owner )
		{
			_owner = owner;
			_owner.PropertyChanged += OnOwnerPropertyChanged;
		}

		private void OnOwnerPropertyChanged( object sender, PropertyChangedEventArgs e )
		{
			if( e.PropertyName == "CurrentWorld" )
				RaisePropertyChanged( () => CurrentWorld );
		}

		public DynamicWorld CurrentWorld
		{
			get { return _owner.CurrentWorld; }
		}
	}
}